/**
 * $Id: MessageBoardService.java 10 2010-11-02 15:31:48Z feigme $
 */
package com.iary.service;

import java.util.ArrayList;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.iary.core.orm.Page;
import com.iary.core.orm.PropertyFilter;
import com.iary.dao.LeaveMessageDao;
import com.iary.entity.LeaveMessage;

@Transactional
@Service
public class MessageBoardService {

	private LeaveMessageDao leaveMessageDao;

	@Autowired
	public void setLeaveMessageDao(LeaveMessageDao leaveMessageDao) {
		this.leaveMessageDao = leaveMessageDao;
	}

	public void createLeaveMessage(LeaveMessage leaveMessage) {
		leaveMessageDao.save(leaveMessage);
	}

	public void createReplyMessage(LeaveMessage leaveMessage) {
		leaveMessageDao.save(leaveMessage);
	}

	public void deleteLeaveMessage(Long id) {
		leaveMessageDao.delete(id);
	}

	@Transactional(readOnly = true)
	public Page<LeaveMessage> listLeaveMessage(Page<LeaveMessage> page) {
		return leaveMessageDao.findPage(page, new ArrayList<PropertyFilter>());
	}

}
